<!--
 * @Description: 树结构组件
 * @Author: wangwangwang
 * @Date: 2020-06-29 15:59:29
 * @LastEditors: wangwangwang
 * @LastEditTime: 2021-03-19 11:26:31
-->
<template>
  <section class="tree-container">
    <el-tree ref="tree" highlight-current class="tree-line"  :indent="0"  :data="arr" node-key="id" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  </section>
</template>
<script>
export default {
  data() {
    return {
      defaultProps: {
        children: "children",
        label: "name"
      }
    };
  },
  props: {
    arr: {
      default: []
    }
  },
  mounted() {
  },
  methods: {
    handleNodeClick(e) {
      this.$emit("chooseTree", e);
    },
    clearSelect () {
      this.$refs.tree.setCurrentKey(null);
    },
  }
};
</script>
<style>
.is-current > .el-tree-node__content {
  color: var(--bg_color);
}
</style>
<style scoped>
.tree-container {
  background: #fff;
  padding: 20px 15px;
  /* border-right: 1px solid #E1E5ED; */
  width: 200px;
}
</style>
